﻿Imports Mysoft.Map.Data
Imports Mysoft.PubProject.Business
Partial Public Class BizParamSetting_Import_Right
    Inherits Mysoft.Map.Application.Security.AppPage
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim strSQL As String
        Dim dtParam As DataTable

        strSQL = "SELECT * FROM myBizParamOption " & _
                " WHERE ScopeGUID='" & Request.QueryString("buguid") & "' AND ParamName='" & Request.QueryString("param") & "' " & _
                " ORDER BY ParamCode"

        dtParam = MyDB.GetDataTable(strSQL)

        '自动添加根
        Dim drParam As DataRow = dtParam.NewRow()
        drParam.Item("ParamCode") = "0"
        drParam.Item("ParentCode") = "."
        drParam.Item("ParamLevel") = 0

        Dim myBizParamRegistDTL As BizParamRegistDTL = BizParamRegistDB.GetDTLByName(Request.QueryString("param"))

        lblParamName.Text = myBizParamRegistDTL.ParamNameChn + "（" + myBizParamRegistDTL.Scope + "级）"

        drParam.Item("ParamValue") = lblParamName.Text
        drParam.Item("IfSys") = 1

        dtParam.Rows.InsertAt(drParam, 0)

        '绑定
        repParam.BindMode = 1          '绑定模式：0 -- SQL 语句绑定，1 -- DataTable 绑定
        repParam.DataTable = dtParam
        repParam.DataBind()
    End Sub

End Class